/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package rule.occurance;

import rule.Rule;

/**
 *
 * @author Daniel Gribel
 */
public class LowerCaseOccuranceRule extends OccuranceRule {
  
    public LowerCaseOccuranceRule(int numDigits, int score) {
        super(numDigits, score);
        setScore(0);
    }
    
    @Override
    public void checkConditions(String dataEntry) {
        super.checkConditions(dataEntry);
        setLog(getScore() + " points for at least " + getNumDigits() + " lower case letters");
    }
    
    @Override
    public boolean checkType(char character) {
        return (Character.isLetter(character) && Character.isLowerCase(character));
    }

    @Override
    public String outputMessage() {
        return getLog();
    }

}
